#!/usr/bin/expect

spawn build/bin/observer -f etc/observer.ini -P cli 
expect "miniob >"
send "drop table null_table\r"
expect "miniob >"
send "drop table null_table2\r"
expect "miniob >"
send "CREATE TABLE null_table(id int, num int nullable, price float not null, birthday date nullable);\r"
expect "miniob >"
send "CREATE TABLE null_table2(id int, num int nullable, price float not null, birthday date nullable);\r"
expect "miniob >"
send "CREATE INDEX index_num on null_table(num);\r"
expect "miniob >"
send "INSERT INTO null_table VALUES (1, 18, 10.0, '2020-01-01');\r"
expect "miniob >"
send "INSERT INTO null_table VALUES (2, null, 20.0, '2010-01-11');\r"
expect "miniob >"
send "SELECT null_table.num,null_table2.num,null_table.birthday FROM null_table,null_table2 where null_table.num=null_table2.num;\r"
expect "miniob >"
interact